package com.thinvent.foxit.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
//地址指向mappe层 持久层也就是Dao接口
@MapperScan("com.thinvent.remotepassword.mapper")
public class MybatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
//调用的mybatis的分页拦截器
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();//我们在此选择数据库的类型，也有其他的参数我这边选择的mysq1
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
